﻿using System;
using System.Linq;
using System.Reflection.Emit;

namespace System.Reflection
{
	// Token: 0x0200012D RID: 301
	public static class ReflectionExtensions
	{
		// Token: 0x06000479 RID: 1145 RVA: 0x00013A8E File Offset: 0x00011E8E
		public static MethodInfo GetRuntimeMethod_wzh(this Type type, string name, Type[] types)
		{
			return type.GetMethod(name, types);
		}

        // Token: 0x0600047A RID: 1146 RVA: 0x00013A98 File Offset: 0x00011E98
        public static TypeInfo_wzh GetTypeInfo_wzh(this Type type)
        {
            return new TypeInfo_wzh(type);
        }

        // Token: 0x0600047B RID: 1147 RVA: 0x00013AA0 File Offset: 0x00011EA0
        public static TypeInfo_wzh CreateTypeInfo(this TypeBuilder type)
		{
			return new TypeInfo_wzh(type.CreateType());
		}

		// Token: 0x0600047C RID: 1148 RVA: 0x00013AAD File Offset: 0x00011EAD
		public static MethodInfo GetRuntimeMethods_wzh(this Type type, string name)
		{
			return type.GetMethod(name);
		}

		// Token: 0x0600047D RID: 1149 RVA: 0x00013AB6 File Offset: 0x00011EB6
		public static MethodInfo[] GetRuntimeMethods_wzh(this Type type)
		{
			return type.GetMethods();
		}

		// Token: 0x0600047E RID: 1150 RVA: 0x00013ABE File Offset: 0x00011EBE
		public static PropertyInfo GetRuntimeProperty(this Type type, string name)
		{
			return type.GetProperty(name);
		}

		// Token: 0x0600047F RID: 1151 RVA: 0x00013AC7 File Offset: 0x00011EC7
		public static PropertyInfo[] GetRuntimeProperties(this Type type)
		{
			return type.GetProperties();
		}

		// Token: 0x06000480 RID: 1152 RVA: 0x00013ACF File Offset: 0x00011ECF
		public static FieldInfo GetRuntimeField(this Type type, string name)
		{
			return type.GetField(name);
		}

		// Token: 0x06000481 RID: 1153 RVA: 0x00013AD8 File Offset: 0x00011ED8
		public static FieldInfo[] GetRuntimeFields(this Type type)
		{
			return type.GetFields();
		}

		// Token: 0x06000482 RID: 1154 RVA: 0x00013AE0 File Offset: 0x00011EE0
		public static T GetCustomAttribute<T>(this FieldInfo type, bool inherit) where T : Attribute
		{
			return type.GetCustomAttributes(inherit).OfType<T>().FirstOrDefault<T>();
		}

		// Token: 0x06000483 RID: 1155 RVA: 0x00013AF3 File Offset: 0x00011EF3
		public static T GetCustomAttribute<T>(this PropertyInfo type, bool inherit) where T : Attribute
		{
			return type.GetCustomAttributes(inherit).OfType<T>().FirstOrDefault<T>();
		}

		// Token: 0x06000484 RID: 1156 RVA: 0x00013B06 File Offset: 0x00011F06
		public static T GetCustomAttribute<T>(this ConstructorInfo type, bool inherit) where T : Attribute
		{
			return type.GetCustomAttributes(inherit).OfType<T>().FirstOrDefault<T>();
		}
	}
}
